//
//  AppDelegate.m
//  WYCweibo
//
//  Created by 魏云超 on 15/11/8.
//  Copyright (c) 2015年 魏云超. All rights reserved.
//

#import "AppDelegate.h"
#import "WYCAccount.h"
#import "WYCTabBarController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

-(void)applicationDidFinishLaunching:(UIApplication *)application
{
    
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    [DDLog addLogger:[DDTTYLogger sharedInstance]];
    [[DDTTYLogger sharedInstance] setColorsEnabled:YES];

    //2.创建window
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    //2.1显示window
    [self.window makeKeyAndVisible];
    
    //3.判断是否需要显示新特性或者欢迎界面或者默认界面
    WYCAccount *account = [WYCAccount accountFromSandbox];
    if (account != nil) {
        //判断显示新特性还是欢迎
        [self.window chooseRootViewController];
        
    }else{
        //已经登陆 显示默认界面
        UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        UIViewController *vc = sb.instantiateInitialViewController;
        self.window.rootViewController = vc;
    }
    //4.显示window
    return YES;
}


@end
